import abc

from common_config import *


class AbstractConfig(abc.ABC):

    def __init__(self, input_params):
        self.input_params = input_params

    @abc.abstractmethod
    def select_columns(self) -> list:
        pass

    @abc.abstractmethod
    def select_days(self) -> int:
        pass

    @abc.abstractmethod
    def version(self) -> str:
        pass

    @abc.abstractmethod
    def system_tye(self) -> SystemType:
        pass

    @abc.abstractmethod
    def fault_code(self) -> FaultCode:
        pass

    @abc.abstractmethod
    def proto_col(self) -> ProtoCol:
        pass

    @abc.abstractmethod
    def table(self) -> TableName:
        pass


class SingleSystemConfig(AbstractConfig, abc.ABC):

    def version(self) -> str:
        return single_version

    def system_tye(self) -> SystemType:
        return SystemType.SINGLE


class DoubleSystemConfig(AbstractConfig, abc.ABC):

    def version(self) -> str:
        return double_version

    def system_tye(self) -> SystemType:
        return SystemType.DOUBLE


class SingleSystemHttpConfig(SingleSystemConfig, abc.ABC):
    def proto_col(self) -> ProtoCol:
        return ProtoCol.HTTP

    def table(self) -> TableName:
        return TableName.HTTP


class SingleSystemMqttConfig(SingleSystemConfig, abc.ABC):
    def proto_col(self) -> ProtoCol:
        return ProtoCol.MQTT

    def table(self) -> TableName:
        return TableName.MQTT


class DoubleSystemHttpConfig(DoubleSystemConfig, abc.ABC):
    def proto_col(self) -> ProtoCol:
        return ProtoCol.HTTP

    def table(self) -> TableName:
        return TableName.HTTP


class DoubleSystemMqttConfig(DoubleSystemConfig, abc.ABC):
    def proto_col(self) -> ProtoCol:
        return ProtoCol.MQTT

    def table(self) -> TableName:
        return TableName.MQTT
